/*
 * @Author       : Bing Chen chenbing@iocharger.com
 * @Date         : 2024-05-20 22:47:26
 * @LastEditors  : Bing Chen chenbing@iocharger.com
 * @LastEditTime : 2025-03-15 12:55:12
 * @FilePath     : \openchaoji-corelib\shared\include\OpenChaoJi_config.h
 * @Description  : 各种编译宏开关, 厂家集成时可按照实际情况打开或关闭这些开关来裁剪合适的目标文件
 *
 * Copyright (c) 2025 OpenChaoJi
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the icense for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef __OPEN_CHAOJI_CONFIG_H__
#define __OPEN_CHAOJI_CONFIG_H__

#define CONFIG_YES  1
#define CONFIG_NO   0

/**
 * 是否使用libc提供的标准内存管理函数
*/
#define OPENCHAOJI_CONFIG_MEMORY_STD_LIBC                       0
#define OPENCHAOJI_CONFIG_MEMORY_TLSF                           1
#define OPENCHAOJI_CONFIG_MEMORY_CUSTOM_LIBC                    2
#define OPENCHAOJI_CONFIG_MEMORY_MANAGER                        OPENCHAOJI_CONFIG_MEMORY_TLSF

/**
 * 全局的log编译级别, EVCC/SECC/Share各自可以定义Log级别来覆盖本定义级别
*/
#ifndef OPENCHAOJI_DEFAULT_LOGLEVEL
#define OPENCHAOJI_DEFAULT_LOGLEVEL     DBGL_DEBUG
#endif

/**
 * 是否启用A类系统
*/
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_A                       CONFIG_YES
/**
 * 是否启用B类系统
*/
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B                       CONFIG_YES

/**
 * B类系统的所有可选模块和可重载模块编译开关
*/
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B == CONFIG_YES)

/* 鉴权 - 功能模块开关 */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_AUTH             CONFIG_YES

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_AUTH == CONFIG_YES)
/* 鉴权 - RFID模式(FDC=1) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_RFID         CONFIG_YES
/* 鉴权 - EVIN模式(FDC=2) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_EVIN         CONFIG_YES
#else
#undef OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_RFID
#undef OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_EVIN
#endif



/* 预约 - 功能模块开关 */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_RESERVE          CONFIG_YES

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_RESERVE == CONFIG_YES)
/* 预约 - 车辆预约模式(FDC=1) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_RESERVE_EVCC      CONFIG_YES
#else
#undef OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_RESERVE_EVCC
#endif



/* 系统自检 - 功能模块开关 */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SELFCHECK        CONFIG_YES

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SELFCHECK == CONFIG_YES)
/* 系统自检 - 通用系统自检(FDC=1) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SELFCHECK_GENERAL CONFIG_YES
#else
#undef OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SELFCHECK_GENERAL
#endif



/* 供电模式 - 功能模块开关 */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SUPPLY           CONFIG_NO

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SUPPLY == CONFIG_YES)
/* 供电模式 - 基本供电模式(FDC=1) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SUPPLY_BASIC      CONFIG_YES
#else
#undef OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SUPPLY_BASIC
#endif



/* 预充及能量传输 - 必选项目, 无功能模块开关 */
/* 预充及能量传输 - 充电模式能量传输(FDC=1) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_CHARGING     CONFIG_YES
/* 预充及能量传输 - 放电模式能量传输(FDC=2) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_DISCHARGING  CONFIG_NO


/* 服务统计 - 停止中功能模块开关(程序默认配置为YES) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS_STOPING       CONFIG_YES
/* 服务统计 - 充电服务统计功能模块开关 */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS       CONFIG_YES

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS_STOPING == CONFIG_YES)
/* 服务统计 - 停止中(FDC=1) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS_STOPING_CHARGE  CONFIG_YES
#else
#undef OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS_STOPING_CHARGE
#endif

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS == CONFIG_YES)
/* 服务统计 - 充电服务统计(FDC=1) */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_STATISTICS CONFIG_YES
#else
#undef OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_STATISTICS
#endif

/* 服务空闲 - 功能模块开关 */
#define OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SERVICE_IDLE     CONFIG_NO


#endif      /* OPENCHAOJI_CONFIG_ENABLE_GBT27930_B */

#endif
